package 徒步旅行中的解题问题;

public class 暴力枚举搜索 {
    public static int L(int[] num, int i){
        int maxLen=1;
        if(i==num.length-1){
            return 1;
        }
        for(int j=i+1;j<num.length;j++){
            if(num[j]>num[i]){
                maxLen=Math.max(maxLen,L(num,j)+1);
            }
        }
        return maxLen;
    }

    public static void main(String[] args) {
        int[] num={1,5,2,4,3};
        int maxLen=0;
        for(int i=0;i<num.length;i++){
            maxLen=Math.max(maxLen,L(num,i));
        }
        System.out.println(maxLen);
    }
}
